import PageTools from '@/components/PageTools/PageTools.vue'
import request from '@/utils/request'
import UploadImg from '@/components/UploadImg'
const plugin = {
  install(Vue) {
    Vue.component(PageTools.name, PageTools)
    Vue.component(UploadImg.name, UploadImg)
    Vue.prototype.$http = {
      post: function(url, data) {
        return request.post(url, data)
      },
      get: function(url, params) {
        return params ? request.get(url, { params }) : request.get(url)
      },
      put(url, data) {
        return request.put(url, data)
      },
      delete(url, params) {
        return params ? request.delete(url, { params }) : request.get(url)
      }
    }
  }
}
export default plugin
